#ifndef __LYNX_SOUND_SOURCE_C_HPP_INCLUDED__
#define __LYNX_SOUND_SOURCE_C_HPP_INCLUDED__

#include "LynxSoundSource.hpp"
#include "LynxAudioReader.hpp"
#include "LynxAudioManager_C.hpp"
#include <AL/al.h>
#include <list>

namespace Lynx
{
namespace Audio
{

class SoundSource_C : public SoundSource
{
public:
    SoundSource_C(AudioManager_C *manager, AudioReader *reader, bool streaming, const std::string &name);

    virtual ~SoundSource_C();

    virtual const std::string &get_name(void) const;

    virtual void set_name(const std::string &new_name);

    virtual AudioFormat get_audio_format(void) const;

    virtual bool is_streaming(void) const;

    virtual bool is_random_access(void) const;

    ALuint get_samples_everything() const;

    void grab_static(Sound *sound);

    void release_static(Sound *sound);

private:
    AudioManager_C *mManager;

    std::string mName;
    std::list<Sound*> mConnectedSounds;
    AudioReader *mReader;
    bool mStreaming;
    AudioFormat mFormat;

    ALuint mBuffer;
};

} // namespace Audio
} // namespace Lynx

#endif // __LYNX_SOUND_SOURCE_C_HPP_INCLUDED__

